package com.wuyou.designPatterns.observer;

/**
 * 以数字形式显示观察到的数值
 *
 * @Date 2024/10/15 17:25
 * @Author 无忧
 */
public class DigitObserver implements Observer{


    @Override
    public void update(NumberGenerator generator) {
        System.out.println("DigitObserver: " + generator.getNumber());
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
